<template>
    <div>
        <div class="layout-main">
            <el-row>
                <el-col :span="8">
                    <el-form ref="merchant" label-position="right" label-width="120px" :model="merchant" :rules="rules">
                        <el-input size="small" type="hidden" :model="merchant.id" />
                        <el-form-item label="登录名" prop="merName">
                            <el-input size="small" readonly v-model="merchant.merName" placeholder="登录名" />
                            <el-button size="small" @click="setLoginName">设置登录名</el-button>
                            <label>*可用来登陆，设置一次之后不可在设置</label>
                        </el-form-item>
                        <el-form-item label="手机号码" prop="phone">
                            <el-input size="small" disabled readonly v-model="merchant.phone" placeholder="手机号码" />
                        </el-form-item>
                    </el-form>
                </el-col>
            </el-row>
        </div>
        <CSetLoginName ref="dialogUser" @ok="getDetail()" />
    </div>
</template>
<script>
import CSetLoginName from "./CSetLoginName.vue"
import api from '@/api/api';
export default {
    name: 'Merchant',
    data() {
        return {

            loading: false,
            modalLoading: false,

            others: {

            },
            merchant: {

            },
            rules: {

            },

        };
    },
    mounted: function() {

        this.getDetail();

    },
    components: {
        CSetLoginName
    },
    methods: {
        setLoginName: function() {
            this.$refs["dialogUser"].showDialog();
        },
        cbtime: function(value) {
            this.others;
        },
        getDetail: function() {

            var me = this;


            me.showLoading();
            me.$http.post(api.userInfo).then(response => {
                var body = response;
                if (body.status == 0) {
                    me.merchant = body.obj;

                } else {
                    me.errorMessage(body.info);
                }
                me.hideLoading();
            }, response => {
                me.hideLoading();
            });
        }

    }
}
</script>
<style scoped>
</style>